package states;

import monitor.StateVariableMonitor;
import gui.OpCom;
import regulators.BallAndBeamRegul;
import regulators.BeamRegul;
import se.lth.control.realtime.*;

/**
 * Keeps track of current state and methods according to interface.
 * @author Daniellocal
 *
 */
	public class StateClass {
		private static State currentState;
		public DigitalOut digitalSolenoid;
		public DigitalIn initialPosSensor;
		public  BeamRegul 	beam;
		public BallAndBeamRegul ballAndBeam;
		public StateVariableMonitor stateVariableMonitor;
		public OpCom op;
		
		public StateClass(DigitalIn initialPosSensor, DigitalOut digitalSolenoid, BeamRegul beam, BallAndBeamRegul ballAndBeam, OpCom op, StateVariableMonitor stateVariableMonitor ) { 
		      this.digitalSolenoid = digitalSolenoid;
		      this.ballAndBeam = ballAndBeam;
		      this.beam = beam;
		      this.op = op;
		      this.initialPosSensor = initialPosSensor;
		      this.stateVariableMonitor = stateVariableMonitor; 
		      }
		
	
		public static void setCurrentState( State s ) {
		      currentState = s; 
		      }
		
		public void initialExecution() {
		      currentState.initialExcecution(); 
		      }
		
		public void execute() {
		      currentState.excecute(); 
		      }
		
		public boolean stateOFExcecution() {
		      return currentState.stateOfExcecution(); 
		      }
		
		public void nextState() {
		      currentState.nextState(); 
		      }
		
		public void suspend() {
		      currentState.suspend(); 
		      }
		
		public void resume() {
		      currentState.resume(); 
		      }
		
		
	}